#include <iostream>
#include <queue>
#include <stack>
#include <string>

using namespace std;

bool palin(char word[], int s, int e)
{
	if (s >= e)
	{
		return true;
	}
	else
	{
		return word[s] == word[e] && palin(word, s + 1, e - 1);
	}	
}

void palindrom()
{
	while (true)
	{
		string word;
		getline(cin, word);
		if (word.size() == 0)
			break;
		stack<char> s;
		queue<char> q;
		for (int i = 0; i < word.length(); i++)
		{
			s.push(word[i]);
			q.push(word[i]);
		}
		while (!s.empty())
		{
			if (s.top() != q.front())
				break;
			s.pop();
			q.pop();
		}
		if (!s.empty() && !q.empty())
			cout << word << " is not a palindrome" << endl;
		else
			cout << word << " is a palindrome" << endl;
	}
}

int main()
{
	if (palin("kalle", 0, 4))
	{
		cout << "kalle" << endl;
	}
	if (palin("naturrutan", 0, 9))
	{
		cout << "naturrutan" << endl;
	}

	palindrom();

	system("pause");
	return 0;
}